In the field of storage technologies, virtualization technologies are widely used. Multiple virtual machines are usually created on one server, and each virtual machine may be used as an independent device to be managed and used. An operating system of the server is referred to as a host system, and an operating system of each virtual machine is referred to as a client system. After a virtual machine is created, the host system provides a virtual disk for a client system of the virtual machine such that the client system uses the virtual disk when running. From a perspective of the host system, the virtual disk is actually a file. Therefore, the virtual disk may also be referred to as a virtual disk file. When using the virtual disk, the client system may perform various operations such as adding, modifying, or deleting a file in the virtual disk. The client system interacts with the host system using a virtualization layer in the host system when performing an operation on the virtual disk. Similar to a compressed package, the virtual disk gradually expands as the virtual machine runs and is used. However, the virtual disk does not automatically lessen according to a deletion operation of the client system.
A conventional virtual disk lessening method is that after a virtual machine stops running, a user performs a compression operation on a virtual disk using a tool in order to lessen the virtual disk.
However, when the virtual disk is lessened using the conventional virtual disk lessening method, a service of the virtual machine is interrupted because the virtual machine stops running. In this way, data transmission and use on the virtual machine are affected, and consequently, work efficiency of the virtual machine is relatively low.